<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>table模块快速使用</title>
    <link rel="stylesheet" href="/layui/lib/layui-v2.5.5/css/layui.css" media="all">

    <link rel="stylesheet" href="/js/layui_exts/tree_themes/auth-skin-default.css">

</head>
<body>
<form class="layui-form">
    <input type="hidden" name="id" value="{{ $rows->id }}">
    <div class="layui-form-item">
        <label class="layui-form-label">选择时间</label>
        <div class="layui-inline"> <!-- 注意：这一层元素并不是必须的 -->
            <input type="text"name="date" class="layui-input" id="test1">
        </div>
    </div>
    <div class="layui-form-item" style="width: 300px">
        <select name="city" lay-verify="">
            <option value="">请选择阿姨</option>
            @foreach($ay as $k1=>$v1)
                <option value="{{ $v1->id }}"@if($v1->id == $pid) selected  @endif>{{ $v1->name }}</option>
            @endforeach
        </select>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">时间</label>
        @foreach($sj as $k=>$v)
            <input type="checkbox" name="time[]" title="{{ $v }}"value="{{ $v }}" checked>
            @endforeach
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" type="submit" lay-submit lay-filter="LAY-auth-tree-submit">提交</button>
            <button class="layui-btn layui-btn-primary" type="reset">重置</button>
        </div>
    </div>
</form>
<script src="/layui/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="/layui/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['jquery', 'form','laydate'], function(){
        var $ = layui.jquery;
        var form = layui.form;
        var laydate = layui.laydate;
        //执行一个laydate实例

        form.on('submit(LAY-auth-tree-submit)', function(obj){
            var result=obj.field;
            $.post("/admin/date_update",{'_token':'{{ csrf_token() }}',result},function(res){
                if(res==1){
                    parent.layer.closeAll();
                    parent.location.reload();
                }
            })
            return false;
        });
        laydate.render({
            elem: '#test1' //指定元素
            ,value: "{{ $rows->date }}"
        });
    });

</script>
</body>
</html>